/*
 * pmic-g2227.h 
 *
 * Copyright (C) 2017 Realtek Semiconductor Corporation
 * Copyright (C) 2017 Cheng-Yu Lee <cylee12@realtek.com>
 */
#ifndef __PMIC_G2227_H__
#define __PMIC_G2227_H__

enum {
	PMIC_G2227_LPOFF_TO_DO = 0,
	PMIC_G2227_TIME_LPOFF,
	PMIC_G2227_TIME_LP,
	PMIC_G2227_TIME_IT,
	PMIC_G2227_SOFTOFF,

	PMIC_G2227_DC1_ON,
	PMIC_G2227_DC1_NMODE,
	PMIC_G2227_DC1_SMODE,
	PMIC_G2227_DC1_NVO,
	PMIC_G2227_DC1_SVO,

	PMIC_G2227_DC2_ON,
	PMIC_G2227_DC2_NMODE,
	PMIC_G2227_DC2_SMODE,
	PMIC_G2227_DC2_NVO,
	PMIC_G2227_DC2_SVO,

	PMIC_G2227_DC3_ON,
	PMIC_G2227_DC3_NMODE,
	PMIC_G2227_DC3_SMODE,
	PMIC_G2227_DC3_NVO,
	PMIC_G2227_DC3_SVO,

	PMIC_G2227_DC4_ON,
	PMIC_G2227_DC4_NMODE,
	PMIC_G2227_DC4_SMODE,

	PMIC_G2227_DC5_ON,
	PMIC_G2227_DC5_NMODE,
	PMIC_G2227_DC5_SMODE,
	PMIC_G2227_DC5_NVO,
	PMIC_G2227_DC5_SVO,

	PMIC_G2227_DC6_ON,
	PMIC_G2227_DC6_NMODE,
	PMIC_G2227_DC6_SMODE,
	PMIC_G2227_DC6_NVO,
	PMIC_G2227_DC6_SVO,

	PMIC_G2227_LDO2_ON,
	PMIC_G2227_LDO2_NMODE,
	PMIC_G2227_LDO2_SMODE,
	PMIC_G2227_LDO2_NVO,
	PMIC_G2227_LDO2_SVO,

	PMIC_G2227_LDO3_ON,
	PMIC_G2227_LDO3_NMODE,
	PMIC_G2227_LDO3_SMODE,
	PMIC_G2227_LDO3_NVO,
	PMIC_G2227_LDO3_SVO,

	PMIC_G2227_CHIP_ID,
	PMIC_G2227_VERSION,

	PMIC_G2227_MAX
};

/* Power Keys selection */
enum {
	KEY_NOT_PRESSED = 0,
	KEY_PRESSED     = 1,
};

enum {
	LPOFF_TO_DO_ACT1, /* Remain in shutdown mode */
	LPOFF_TO_DO_ACT2, /* Re-startup by sequence */
};

enum {
	ENLPOFF_NO  = 0,
	ENLPOFF_YES = 1,
};

enum {
	TIME_IT_0128_ms = 0,
	TIME_IT_0500_ms = 1,
	TIME_IT_1000_ms = 2,
	TIME_IT_1500_ms = 3,
};

enum {
	TIME_LP_01_s = 0,
	TIME_LP_02_s = 1,
	TIME_LP_03_s = 2,
	TIME_LP_04_s = 3,
};

enum {
	TIME_LPOFF_06_s = 0,
	TIME_LPOFF_07_s = 1,
	TIME_LPOFF_08_s = 2,
	TIME_LPOFF_10_s = 3,
};

enum {
	SOFTOFF_POWER_ON  = 0,
	SOFTOFF_POWER_OFF = 1,
};

enum {
	ERR_NO  = 0,
	ERR_YES = 1,
};

enum {
	ONOFF_SHUTDOWN  = 0,
	ONOFF_OPERATION = 1,
};

enum {
	ENDIS_DISABLE = 0,
	ENDIS_ENABLE  = 1,
};

/* DCx Normal mode selection */
enum {
	DC_NMODE_AUTO         = 0,
	DC_NMODE_FORCE_PWM    = 2,
	DC_NMODE_AUTO_WO_ECO  = 3,
};

/* DCx Sleep mode selection */
enum {
	DC_SMODE_AUTO_WO_ECO  = 0,
	DC_SMODE_AUTO         = 1, /* for DCDC4 */
	DC_SMODE_AUTO_NRM_OUT = 1,
	DC_SMODE_AUTO_SPL_OUT = 2,
	DC_SMODE_SHUTDOWN     = 3,
};

enum {
	LDO_NMODE_NORMAL = 0,
	LDO_NMODE_ECO    = 2,
};

enum {
	LDO_SMODE_NRM_OUT  = 0,
	LOD_SMODE_SPL_OUT  = 1,
	LDO_SMODE_ECO      = 2,
	LDO_SMODE_SHUTDOWN = 3,
};

/* DC1 Voltage Table in Normal/Sleep mode */
enum {
	DC_VOL_TBL_1_3000000_uV = 0,
	DC_VOL_TBL_1_3100000_uV = 1,
	DC_VOL_TBL_1_3200000_uV = 2,
	DC_VOL_TBL_1_3300000_uV = 3,
};

/* DC2/DCDC3/DCDC5/DCDC6 Voltage Table in Normal/Sleep mode */
enum {
	DC_VOL_TBL_2_0800000_uV = 0x00,
	DC_VOL_TBL_2_0812500_uV = 0x01,
	DC_VOL_TBL_2_0825000_uV = 0x02,
	DC_VOL_TBL_2_0837500_uV = 0x03,

	DC_VOL_TBL_2_0850000_uV = 0x04,
	DC_VOL_TBL_2_0862500_uV = 0x05,
	DC_VOL_TBL_2_0875000_uV = 0x06,
	DC_VOL_TBL_2_0887500_uV = 0x07,

	DC_VOL_TBL_2_0900000_uV = 0x08,
	DC_VOL_TBL_2_0912500_uV = 0x09,
	DC_VOL_TBL_2_0925000_uV = 0x0a,
	DC_VOL_TBL_2_0937500_uV = 0x0b,

	DC_VOL_TBL_2_0950000_uV = 0x0c,
	DC_VOL_TBL_2_0962500_uV = 0x0d,
	DC_VOL_TBL_2_0975000_uV = 0x0e,
	DC_VOL_TBL_2_0987500_uV = 0x0f,

	DC_VOL_TBL_2_1000000_uV = 0x10,
	DC_VOL_TBL_2_1012500_uV = 0x11,
	DC_VOL_TBL_2_1025000_uV = 0x12,
	DC_VOL_TBL_2_1037500_uV = 0x13,

	DC_VOL_TBL_2_1050000_uV = 0x14,
	DC_VOL_TBL_2_1062500_uV = 0x15,
	DC_VOL_TBL_2_1075000_uV = 0x16,
	DC_VOL_TBL_2_1087500_uV = 0x17,

	DC_VOL_TBL_2_1100000_uV = 0x18,
	DC_VOL_TBL_2_1112500_uV = 0x19,
	DC_VOL_TBL_2_1125000_uV = 0x1a,
	DC_VOL_TBL_2_1137500_uV = 0x1b,

	DC_VOL_TBL_2_1150000_uV = 0x1c,
	DC_VOL_TBL_2_1162500_uV = 0x1d,
	DC_VOL_TBL_2_1175000_uV = 0x1e,
	DC_VOL_TBL_2_1187500_uV = 0x1f,
};

/* LDOx Voltage Table in Normal/Sleep mode */
enum {
	LDO_VOL_TBL_0800000_uV = 0x0,
	LDO_VOL_TBL_0850000_uV = 0x1,
	LDO_VOL_TBL_0900000_uV = 0x2,
	LDO_VOL_TBL_0950000_uV = 0x3,

	LDO_VOL_TBL_1000000_uV = 0x4,
	LDO_VOL_TBL_1100000_uV = 0x5,
	LDO_VOL_TBL_1200000_uV = 0x6,
	LDO_VOL_TBL_1300000_uV = 0x7,

	LDO_VOL_TBL_1500000_uV = 0x8,
	LDO_VOL_TBL_1600000_uV = 0x9,
	LDO_VOL_TBL_1800000_uV = 0xa,
	LDO_VOL_TBL_1900000_uV = 0xb,

	LDO_VOL_TBL_2500000_uV = 0xc,
	LDO_VOL_TBL_2600000_uV = 0xd,
	LDO_VOL_TBL_3000000_uV = 0xe,
	LDO_VOL_TBL_3100000_uV = 0xf,    
};
#endif
